package com.BlogPark.controller;

import com.BlogPark.controller.exception.Code;
import com.BlogPark.controller.result.Result;
import com.BlogPark.pojo.Article;
import com.BlogPark.service.ClassificationService.ClassificationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Auther: MFM
 * @Date: 2022/8/19 - 08 - 19 - 22:05
 * @version: 1.0
 */

@RestController
@RequestMapping("/Classification")
public class ClassificationController {
    @Autowired
    private ClassificationService classificationService;

    @GetMapping("/{labels}")
    public Result Classification(@PathVariable String labels) {
        List<Article> list = classificationService.showArticleList(labels);
        return new Result(Code.GET_OK, list);
    }
}
